<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
    <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    <script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
    <link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css">
    
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/inhospitalDisease.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3>科室归档统计</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table">
                <ul class="clearfix" style="margin-bottom:0;">
                	<li class="Label_1" style="width:12%;">出院日期：&nbsp;</li>
                    <li class="Label_4" style="text-align:left;padding-left:3px;width:32%">
                    	<input class="Wdate input" style="width:44%;" type="text"  name='startTime' id='outHospitalStartDate' value='' onFocus="WdatePicker()" />
                    	<span>&nbsp;-&nbsp;</span><input class="Wdate input" type="text" style="width:44%;"  name='endTime' id='outHospitalEndDate' value='' onFocus="WdatePicker()" />
                    </li>
                   <!--  <li class="Label_1" >出院科室：&nbsp;</li> -->
                  <%--   <li class="Label_2" style="padding-left:3px;" >
                       <select name="officeId" id="officeId" style="width:90%;height:28px;border-color:#e3e5e4">
							<option value="">请选择科室</option>
							<c:forEach items="${hospitalOfficeList}" var="hospitalOffice">
								<option value="${hospitalOffice.id}">${hospitalOffice.name}</option>
							</c:forEach>
						</select>
                    </li> --%>
                    <li class="Label_5">
                        <div class="right" style="text-align:right">
                            <a onclick="searchQue()">查询</a>
                            
                             <a onclick="exportExcel()">导出</a>
                        </div>
                    </li>
                  
                </ul>
            </div> 
        <table class="Search_tableList" cellpadding="0" cellspacing="0">
                <tr style="height:20px">
             
                    <td class="tdLabel_4" rowspan="2">科室</td>
                    <td class="tdLabel_4" style="width:20%" rowspan="2">应归档数</td>
                    <td class="tdLabel_4" style="width:20%" colspan="2">2日</td>
                    <td class="tdLabel_4" style="width:20%" colspan="2">3日</td>
                    <td class="tdLabel_4" style="width:20%" colspan="2">7日</td>
                </tr>
                <tr  style="height:20px">
                    <td class="tdLabel_4" style="width:10%">归档数</td>
                    <td class="tdLabel_4" style="width:10%">归档率</td>
                    <td class="tdLabel_4" style="width:10%">归档数</td>
                    <td class="tdLabel_4" style="width:10%">归档率</td>
                    <td class="tdLabel_4" style="width:10%">归档数</td>
                    <td class="tdLabel_4" style="width:10%">归档率</td>
                </tr>
                
                <tbody id="tbody">
	                 <!-- <tr>
	                    <td class="tdLabel_5">101011-呼吸内科病房</td>
	                    <td class="tdLabel_5">196</td>
	                    <td class="tdLabel_5">195</td>
	                    <td class="tdLabel_5">99.49%</td>
	                    <td class="tdLabel_5">195</td>
	                    <td class="tdLabel_5">99.49%</td>
	                    <td class="tdLabel_5">196</td>
	                    <td class="tdLabel_5">100.0%</td>
	                </tr> -->
                </tbody>
            </table>
        </div>
    </div>
</div>
<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
	function searchQue(){
		var officeId=$("#officeId").val();
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='') && (officeId==null || officeId=='')){
			layer.alert("请输入至少一条查询条件!",{icon:7});
			return;
		}
		$.ajax({
			type:"get",
			url:"${basePath}/retrieval/getMedRecordPigeonholeRate",
			data:{outHospitalStartDate:outHospitalStartDate,outHospitalEndDate:outHospitalEndDate},
			success:function(data){
				/* console.log(data) */
				$("#tbody").html("");
				if(data.success){
					var html="";
					var dataList=data.data;
					if(dataList.length>0){
				    	for(var i=0;i<dataList.length;i++){
				    		var officeName=dataList[i].officeName?dataList[i].officeName:"";
				    		var archivaCount=dataList[i].archivaCount?dataList[i].archivaCount:"0";
				    		var twoDaysPigeonholeCount=dataList[i].twoDaysPigeonholeCount?dataList[i].twoDaysPigeonholeCount:"0";
				    		var twoDaysPigeonholeRate=dataList[i].twoDaysPigeonholeRate?dataList[i].twoDaysPigeonholeRate:"0";
				    		var threeDaysPigeonholeCount=dataList[i].threeDaysPigeonholeCount?dataList[i].threeDaysPigeonholeCount:"0";
				    		var threeDaysPigeonholeRate=dataList[i].threeDaysPigeonholeRate?dataList[i].threeDaysPigeonholeRate:"0";
				    		var sevenDaysPigeonholeCount=dataList[i].sevenDaysPigeonholeCount?dataList[i].sevenDaysPigeonholeCount:"0";
				    		var sevenDaysPigeonholeRate=dataList[i].sevenDaysPigeonholeRate?dataList[i].sevenDaysPigeonholeRate:"0";
				    		html+=" <tr>"+
					              "      <td class='tdLabel_5'>"+officeName+"</td>"+
					              "      <td class='tdLabel_5'>"+archivaCount+"</td>"+
					              "      <td class='tdLabel_5'>"+twoDaysPigeonholeCount+"</td>"+
					              "      <td class='tdLabel_5'>"+twoDaysPigeonholeRate+"%</td>"+
					              "      <td class='tdLabel_5'>"+threeDaysPigeonholeCount+"</td>"+
					              "      <td class='tdLabel_5'>"+threeDaysPigeonholeRate+"%</td>"+
					              "      <td class='tdLabel_5'>"+sevenDaysPigeonholeCount+"</td>"+
					              "      <td class='tdLabel_5'>"+sevenDaysPigeonholeRate+"%</td>"+
					              "  </tr>";
						}
						
						$("#tbody").html(html);
				    }else{
				    	layer.alert("查询的数据为空！",{icon:5})
				    }
				} 
	
			}
		})
		
	}
	
	
	function exportExcel(){
		var outHospitalStartDate=$("#outHospitalStartDate").val();
		var outHospitalEndDate=$("#outHospitalEndDate").val();
		
		
		if((outHospitalStartDate==null || outHospitalStartDate=="") && (outHospitalEndDate==null || outHospitalEndDate=='')){
			layer.alert("请输入至少一条查询条件!",{icon:7});
			return;
		}
		
		window.location.href="${basePath}/retrieval/exportPigonholeExcel?outHospitalStartDate="+outHospitalStartDate+"&outHospitalEndDate="+outHospitalEndDate;
	}
	
</script>

</body>
</html>